<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="layout.xhtml">
        <ui:define name="body">

            <section id="gap"></section>
            <section>
                <div class="container">
                    <div class="row">
                        <h:form id="formloteria">
                            <p:messages autoUpdate="true" />
                            
                            <div class="right">
                                <p:button outcome="loteria.xhtml" value="#{languagem['cadastrar']}" 
                                          styleClass="ui-priority-primary" 
                                          icon="ui-icon-plusthick"/>

                            </div>
                            <h1>Loterias</h1>
                            <p:panel  styleClass="col-md-12" style="border: 0px solid black;">

                                <div class="clear"/>
                                <p:dataTable id="tableLoterias" value="#{managerPesquisarLoteria.loterias}" var="l"
                                             emptyMessage="#{languagem['emptyrecord']}"
                                             selectionMode="single" selection="#{managerPesquisarLoteria.loteria}" rowKey="#{l.id}">
                                    <p:ajax event="rowSelect" listener="#{managerPesquisarLoteria.selectLoteria()}" update="@form" />
                                    <f:facet name="header">
                                        #{languagem['loterias']}
                                    </f:facet>
                                    <p:column headerText="#{languagem['loteria.nome']}">
                                        #{l.nome}
                                    </p:column>
                                </p:dataTable>
                            </p:panel>
                        </h:form>
                    </div>
                </div>
            </section>
        </ui:define>
    </ui:composition>
</html>
